package com.sunshine.lnuplusweb.dao;

import com.sunshine.lnuplusweb.entities.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author sunshine
 * @date 2020.10.27
 * 数据库持久层，对应user表的CRUD
 * 注意加上Mapper注解
 */
@Mapper
public interface UserMapper {
    int insert(User user);

    int login(@Param("userId") String userId, @Param("password") String password);

    List<User> searchAll();

    int getUserCountById(@Param("userId") String userId);

    //通过用户名查找用户
    User getUserById(@Param("userId") String userId);

    void register(@Param("userId") String userId, @Param("password") String password);
}
